home *** CD-ROM | disk | FTP | other *** search
/ Cope with Cancer / Cope with Cancer.iso / mac / cope8bit / cope8bit.dxr / 00002.ls < prev    next >
Encoding:
Text File  |  1998-09-18  |  2.8 KB  |  106 lines

  1. on startMovie
  2.   toggleColorDepth()
  3.   initCOPE()
  4.   if not (the quickTimePresent) then
  5.     qtAlert()
  6.     quit()
  7.   end if
  8.   set the searchPath to []
  9.   set currPath to the pathName
  10.   set firstMovie to "COPINTRO"
  11.   put "startup path = " && currPath
  12.   if the machineType = 256 then
  13.     set delim to "\"
  14.     set fromCD to 0
  15.     set thePath to the pathName & "COPE\FIND\"
  16.     set theFile to "COPE.txt"
  17.     if LocateFile(thePath, theFile) then
  18.       set fromCD to 1
  19.       set pathToLaunch to currPath & "COPE" & delim & firstMovie
  20.       alert("We are running from the CD" & RETURN & pathToLaunch)
  21.     else
  22.       set partPath to "\COPE\FIND\"
  23.       set theFile to "cope.txt"
  24.       set driveLetter to GetDriveLetter(partPath, theFile)
  25.       if driveLetter = -1 then
  26.         alert("Please make sure the CD is inserted, and try again")
  27.         halt()
  28.       else
  29.         set pathToLaunch to driveLetter & ":\COPE" & delim & firstMovie
  30.         set dataPath to currPath & "data" & delim
  31.         add(the searchPath, driveLetter & ":\")
  32.         add(the searchPath, dataPath)
  33.       end if
  34.     end if
  35.   else
  36.     set delim to ":"
  37.     if LocateFile("COPE:COPE:FIND:", "COPE.TXT") then
  38.       set pathToLaunch to "COPE:COPE:COPINTRO"
  39.       set the itemDelimiter to ":"
  40.       if item 1 of currPath = item 1 of pathToLaunch then
  41.       else
  42.       end if
  43.       add(the searchPath, "COPE:COPE:")
  44.       add(the searchPath, "COPE:")
  45.     else
  46.       set tryThisPath to the pathName & "COPE:FIND:"
  47.       if LocateFile(tryThisPath, "COPE.TXT") then
  48.         set pathToLaunch to the pathName & "COPE:COPINTRO"
  49.       else
  50.         alert("Sorry, I can't locate the Cope with Cancer CD-ROM on your system. Please make sure the Cope with Cancer CD is inserted and try again.")
  51.         halt()
  52.       end if
  53.     end if
  54.   end if
  55.   initCOPE()
  56.   go(1, pathToLaunch)
  57. end
  58.  
  59. on qtAlert
  60.   if the machineType = 256 then
  61.     alert("QuickTime for Windows is required in order to run the Cope with Cancer CD.")
  62.   else
  63.     alert("QuickTime is required in order to run the Cope with Cancer CD. QuickTime is supplied on the Cope with Cancer CD.")
  64.   end if
  65. end
  66.  
  67. on GetDriveLetter thePath, theFile
  68.   put "GetDriveLetter:" & "---" & thePath & "---" & theFile
  69.   repeat with i = 67 to 90
  70.     set aPath to numToChar(i) & ":" & thePath
  71.     if LocateFile(aPath, theFile) then
  72.       exit repeat
  73.     end if
  74.   end repeat
  75.   if i <= 90 then
  76.     put thePath && theFile
  77.     return numToChar(i)
  78.   else
  79.     return -1
  80.   end if
  81. end
  82.  
  83. on LocateFile aPath, aFile
  84.   put aPath & aFile
  85.   set bFile to getNthFileNameInFolder(aPath, 1)
  86.   if aFile = bFile then
  87.     return 1
  88.   else
  89.     return 0
  90.   end if
  91. end
  92.  
  93. on toggleColorDepth
  94.   global gUserColorDepth
  95.   set gUserColorDepth to the colorDepth
  96.   if gUserColorDepth = 8 then
  97.     exit
  98.   end if
  99.   if gUserColorDepth > 8 then
  100.     set the colorDepth to 8
  101.   end if
  102.   if gUserColorDepth < 8 then
  103.     set the colorDepth to 8
  104.   end if
  105. end
  106.